import request from '@/utils/request';
import { Focus } from '../model/Focus';
import { R } from '../model/R';


// 获取关注状态
export function isFocus(receiveId: number | string) {
    return request({
        url: `/business/focus/status/${receiveId}`,
        method: 'get'
    });
}

/*关注/取消关注*/
export function focus(receiveId: number | string) {
    return request({
        url: `/business/focus`,
        method: 'post',
        data: { receiveId }
    });
}

/**
 * 获取我关注的
 * @param query
 */
export function getMyFocus(query: any): Promise<R<Focus>> {
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore
    return request({
        url: `/business/focus/my`,
        method: 'get',
        params: query
    });
}
